package com.xinke.module.system.model.vo.oauth2;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.validation.constraints.*;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - OAuth2 授权码新增/修改 Request VO")
@Data
public class OAuth2CodeSaveReqVO {

    @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "6352")
    private Long codeId;

    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8307")
    @NotNull(message = "用户编号不能为空")
    private Long userId;

    @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "用户类型不能为空")
    private Integer userType;

    @Schema(description = "授权码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "授权码不能为空")
    private String oauthCode;

    @Schema(description = "客户端编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户端编号不能为空")
    private String clientNo;

    @Schema(description = "授权范围")
    private String authScope;

    @Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "过期时间不能为空")
    private LocalDateTime expiresTime;

    @Schema(description = "可重定向的 URI 地址")
    private String redirectUri;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "状态不能为空")
    private String codeState;

}